﻿using System;
using CVsharp.Jquery.Tree;
using NUnit.Framework;

namespace CVsharp.Test.NUnit.Jquery
{
    [TestFixture]
    public class TreeTest
    {
        [Test]
        public void Test()
        {
            Tree tree = new Tree();
            Node root = new Node();
            root.Propertys.Add("name", "rootNode");
            root.Propertys.Add("id", "1");
            root.DPropertys.fdfdgfdgfd = "ddddddddddddd";
            Node root2 = new Node();
            root2.Propertys.Add("name", "rootNode");
            root2.Propertys.Add("id", "2");
            tree.RootNodes.Add(root);
            tree.RootNodes.Add(root2);
            Console.WriteLine(tree.ToJsonString("Name", "children"));
            Tree tree2 = Tree.Parse(tree.ToJsonString(), "Name", "children");
            Assert.AreEqual(tree.ToJsonString(),tree2.ToJsonString());
        }
    }
}
